//
//  ShoppingCartTableViewCell.m
//  firstpoint
//
//  Created by 泽中 on 2017/7/5.
//  Copyright © 2017年 xzcysoft. All rights reserved.
//

#import "ShoppingCartTableViewCell.h"

@implementation ShoppingCartTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _seletedButton=[UIButton buttonWithType:UIButtonTypeCustom];
        _seletedButton.frame=CGRectMake(10, 37.5, 25, 25);
        [_seletedButton setImage:[UIImage imageNamed:@"weixuanzhong"] forState:0];
        [_seletedButton setImage:[UIImage imageNamed:@"xuanzhong"] forState:UIControlStateSelected];
         
        [self.contentView addSubview:_seletedButton];
        _imgView=[[UIImageView alloc]initWithFrame:CGRectMake(40, 10, 80, 80)];
        _imgView.image=[UIImage imageNamed:@"timg.jpeg"];
        [self.contentView addSubview:_imgView];
        
        _titleLab=[[UILabel alloc]initWithFrame:CGRectMake(125, 10, width_screen-125, 15)];
        _titleLab.text=@"当海风吹凉霓虹 回首你无影踪 转眼旧盟已成空";
        _titleLab.font=[UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleLab];
        
        _guigeLab=[[UILabel alloc]initWithFrame:CGRectMake(125, 30, 50, 12)];
        _guigeLab.text=@"规格 170";
        _guigeLab.textColor=LRRGBColor(185, 186, 186);
        _guigeLab.font=[UIFont systemFontOfSize:12];
        [self.contentView addSubview:_guigeLab];
        
        _colorLab=[[UILabel alloc]initWithFrame:CGRectMake(200, 30, 70, 12)];
        _colorLab.text=@"颜色:白色";
        _colorLab.font=[UIFont systemFontOfSize:12];
        _colorLab.textColor=LRRGBColor(185, 186, 186);

        [self.contentView addSubview:_colorLab];
        
        _yuanbaoLab=[[UILabel alloc]initWithFrame:CGRectMake(125, 47, width_screen-200, 14)];
        _yuanbaoLab.textColor=[UIColor orangeColor];
        _yuanbaoLab.text=@"180元宝~800金币";
        _yuanbaoLab.font=[UIFont systemFontOfSize:14];
        _yuanbaoLab.textAlignment=NSTextAlignmentLeft;
        [self.contentView addSubview:_yuanbaoLab];
        
        _numLab=[[UILabel alloc]initWithFrame:CGRectMake(125, 66, 50, 14)];
        _numLab.text=@"x 1";
        _numLab.textColor=[UIColor orangeColor];

        _numLab.font=[UIFont systemFontOfSize:14];
        _numLab.textAlignment=NSTextAlignmentLeft;
        [self.contentView addSubview:_numLab];
        
        _deleteButton=[UIButton buttonWithType:UIButtonTypeCustom];
        _deleteButton.frame=CGRectMake(width_screen-60, 65, 50, 25);
        [_deleteButton setTitle:@"删除" forState:0];
        _deleteButton.backgroundColor=[UIColor whiteColor];
        _deleteButton.layer.borderWidth=1;
        _deleteButton.layer.cornerRadius=3;
        _deleteButton.layer.borderColor=LRRGBColor(22, 141, 210).CGColor;
        [_deleteButton setTitleColor:LRRGBColor(22, 141, 210) forState:0];
        _deleteButton.titleLabel.font=[UIFont systemFontOfSize:13];
        [self.contentView addSubview:_deleteButton];

    }
    return self;
}
#pragma mark - 绘制Cell分割线
- (void)drawRect:(CGRect)rect {
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
    CGContextFillRect(context, rect);
    
    
    //下分割线
    CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:198/255.0 green:198/255.0 blue:198/255.0 alpha:1].CGColor);
    CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width, 0));
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
